<template>
  <div class="container">
    <button @click="change">切换</button>
    <Teleport :disabled="isBody" to="body">
      <e />
    </Teleport>
  </div>
</template>

<script setup lang='ts'>
import { ref, reactive } from 'vue'
import E from './13Teleport传送组件/E.vue'

const isBody = ref(true)
const change = () => {
  isBody.value = !isBody.value
}

</script>

<style lang='scss' scoped>
.container {
  top: 200px;
  position: relative;
  height: 50vh;
  background-color: red;
}
</style>